package com.search.service.imp;

import java.io.IOException;

import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.queries.CustomScoreProvider;
import org.apache.lucene.queries.CustomScoreQuery;
import org.apache.lucene.search.Query;

public class RecencyBoostCustomScoreQuery extends CustomScoreQuery{
	// ����  
    private double multiplier;  
    // ��1970-01-01�����������  
    private int day;  
    // ����������  
    private int maxDaysAgo;  
    // �����������  
    private String dayField;  
    public RecencyBoostCustomScoreQuery(Query subQuery,double multiplier,int day,int maxDaysAgo,String dayField) {  
        super(subQuery);  
        this.multiplier = multiplier;  
        this.day = day;  
        this.maxDaysAgo = maxDaysAgo;  
        this.dayField = dayField;  
    }  
  
    @Override  
    protected CustomScoreProvider getCustomScoreProvider(  
            LeafReaderContext context) throws IOException {  
        return new RecencyBoostCustomScoreProvider(context,multiplier,day,maxDaysAgo,dayField);  
    }  
}

